package beans;


import java.io.Serializable;

import oracle.adf.view.rich.component.rich.data.RichTable;
import oracle.adf.view.rich.component.rich.layout.RichPanelBox;
import oracle.adf.view.rich.context.AdfFacesContext;

import org.apache.myfaces.trinidad.event.DisclosureEvent;


public class StudentBB implements Serializable {
    private static final long serialVersionUID = 1L; 
    private boolean studentDislosed = true;
    private boolean materiiDislosed = false;
    private boolean profDislosed = false;
    private RichPanelBox panelBox1;
    private RichPanelBox panelBox2;
    private RichPanelBox panelBox3;
    private RichPanelBox panelBox4;
    private RichTable tableStudenti;


    public StudentBB() {
        super();
   

    }

    public void tabSelectedStudent(DisclosureEvent disclosureEvent) {
        System.out.println("tabSelectedStudent");
        if (disclosureEvent.isExpanded()) {
            System.out.println("tabSelectedStudent");
            //setam panelBoxurile Vizible si Invizibile
            setMateriiDislosed(false);
            setProfDislosed(false);
            setStudentDislosed(true);
            AdfFacesContext context = AdfFacesContext.getCurrentInstance();
            context.addPartialTarget(panelBox1);
            context.addPartialTarget(panelBox2);
            context.addPartialTarget(panelBox3);
            context.addPartialTarget(panelBox4);
        }
    }

    public void tabSelectedMaterii(DisclosureEvent disclosureEvent) {
        System.out.println("tabSelectedMaterii");
        if (disclosureEvent.isExpanded()) {
            System.out.println("tabSelectedMaterii");
            //setam panelBoxurile Vizible si Invizibile
            setMateriiDislosed(true);
            setProfDislosed(false);
            setStudentDislosed(false);
            AdfFacesContext context = AdfFacesContext.getCurrentInstance();
            context.addPartialTarget(panelBox1);
            context.addPartialTarget(panelBox2);
            context.addPartialTarget(panelBox3);
            context.addPartialTarget(panelBox4);
        }
    }

    public void tabSelectedProf(DisclosureEvent disclosureEvent) {
        if (disclosureEvent.isExpanded()) {
            //setam panelBoxurile Vizible si Invizibile
            setMateriiDislosed(false);
            setProfDislosed(true);
            setStudentDislosed(false);
            AdfFacesContext context = AdfFacesContext.getCurrentInstance();
            context.addPartialTarget(panelBox1);
            context.addPartialTarget(panelBox2);
            context.addPartialTarget(panelBox3);
            context.addPartialTarget(panelBox4);
        }
    }

    public void setStudentDislosed(boolean studentDislosed) {
        this.studentDislosed = studentDislosed;
    }

    public boolean isStudentDislosed() {
        return studentDislosed;
    }

    public void setMateriiDislosed(boolean materiiDislosed) {
        this.materiiDislosed = materiiDislosed;
    }

    public boolean isMateriiDislosed() {
        return materiiDislosed;
    }

    public void setProfDislosed(boolean profDislosed) {
        this.profDislosed = profDislosed;
    }

    public boolean isProfDislosed() {
        return profDislosed;
    }

    public void setPanelBox1(RichPanelBox panelBox1) {
        this.panelBox1 = panelBox1;
    }

    public RichPanelBox getPanelBox1() {
        return panelBox1;
    }

    public void setPanelBox2(RichPanelBox panelBox2) {
        this.panelBox2 = panelBox2;
    }

    public RichPanelBox getPanelBox2() {
        return panelBox2;
    }

    public void setPanelBox3(RichPanelBox panelBox3) {
        this.panelBox3 = panelBox3;
    }

    public RichPanelBox getPanelBox3() {
        return panelBox3;
    }

    public void setPanelBox4(RichPanelBox panelBox4) {
        this.panelBox4 = panelBox4;
    }

    public RichPanelBox getPanelBox4() {
        return panelBox4;
    }


    public void setTableStudenti(RichTable tableStudenti) {
        this.tableStudenti = tableStudenti;
    }

    public RichTable getTableStudenti() {
        return tableStudenti;
    }



}
